package eerbaar.shared.persist;

import eerbaar.shared.exceptions.GameException;
import eerbaar.shared.service.IService;
import eerbaar.shared.tree.INode;


public interface IPersistService extends IService {

    <T> ISaver<T> getLeastDerivedClass(ISaver<?> inSavable);

    <T> IPersister<T> getPersister(Class<T> type);

    <T> IPersister<T> getPersister(Class<T> type, String name);

    <T> T load(Class<T> type, INode node) throws GameException;

    <T> void register(Class<T> clazz, IPersister<T> persistable);

    <T> INode save(Class<T> type, ISaver<T> saveable);

}
